package com.itstu.gulimall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itstu.common.utils.PageUtils;
import com.itstu.common.valid.AddGroup;
import com.itstu.common.valid.UpdateGroup;
import com.itstu.gulimall.product.entity.BrandEntity;
import com.itstu.gulimall.product.entity.CategoryBrandRelationEntity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.List;
import java.util.Map;

/**
 * 品牌分类关联
 *
 * @author shhjiang
 * @email shhjiang_001@163.com
 * @date 2020-04-23 11:19:50
 */
public interface CategoryBrandRelationService extends IService<CategoryBrandRelationEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveDetil(CategoryBrandRelationEntity categoryBrandRelation);


    void updateBrand(@Null(message = "新增不能指定品牌id", groups = {AddGroup.class}) @NotNull(message = "修改必必须指定品牌id", groups = {UpdateGroup.class}) Long brandId, @NotBlank(message = "品牌名必须提交", groups = {AddGroup.class, UpdateGroup.class}) String name);

    void updateCascade(Long catId, String name);

    List<BrandEntity> getBrandsByCatId(Long catId);
}

